/***************************************************************************
 *   Copyleft 2006-2007 by												   *
 *	 Iwanicki Krzysztof													   *
 *   <gamma.mini.pw.edu.pl/~iwanickik>			                           *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 ***************************************************************************/
#include "./AboutDialog.h"

/**************************************************************
* Constructors                                                *
***************************************************************/
AboutDialog::AboutDialog (HINSTANCE hInstance, HWND hOwnerWnd): AbstractDialog (hOwnerWnd) {
	HWND hWnd = ::CreateDialog(hInstance, MAKEINTRESOURCE (IDD_DIALOG_ABOUT),
		hOwnerWnd, (DLGPROC) DialogProc);
	::ShowWindow(hWnd, SW_SHOW);
}

/**************************************************************
* Other helpfull functions                                    *
***************************************************************/
LRESULT CALLBACK AboutDialog:: DialogProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
	switch(message)	{
		case WM_INITDIALOG:
			::InitCommonControls();
			//HWND hWndDrag  = ::GetDlgItem(hWndDlg, IDC_DRAG);
			//::SetWindowLong(hWndDrag, GWL_EXSTYLE, WS_EX_LAYERED | SS_OWNERDRAW);
			break;
		/*case WM_DRAWITEM: {
			LPDRAWITEMSTRUCT pdis;
			RECT rectDrag, rectfrom;
			HDC hDC;
			HWND hDrawItem;

			pdis = (LPDRAWITEMSTRUCT) lParam;
			hDC = pdis->hDC;
			hDrawItem = pdis->hwndItem;
			::GetClientRect(hDrawItem, &rectDrag);
			::GetWindowRect(hDrawItem, &rectfrom);
			::BitBlt(hDC, rectDrag.left, rectDrag.top, rectDrag.right, rectDrag.bottom, 
				hPomDC, rectfrom.left, rectfrom.top, SRCCOPY); }
			break;*/
		case WM_CLOSE:
		case WM_COMMAND:
			::DestroyWindow(hWnd);
			break;
		default:
			return false;
	}
	return false ;
}